<?php

/**
 * Preciocomb filter form base class.
 *
 * @package    aeropostal
 * @subpackage filter
 * @author     Your name here
 */
abstract class BasePreciocombFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'moneda'    => new sfWidgetFormPropelChoice(array('model' => 'Moneda', 'add_empty' => true)),
      'uMedida'   => new sfWidgetFormPropelChoice(array('model' => 'Unidmedida', 'add_empty' => true)),
      'precio'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'moneda'    => new sfValidatorPropelChoice(array('required' => false, 'model' => 'Moneda', 'column' => 'id')),
      'uMedida'   => new sfValidatorPropelChoice(array('required' => false, 'model' => 'Unidmedida', 'column' => 'simbolo')),
      'precio'    => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('preciocomb_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Preciocomb';
  }

  public function getFields()
  {
    return array(
      'fecha1'    => 'Date',
      'proveedor' => 'ForeignKey',
      'estacion'  => 'ForeignKey',
      'moneda'    => 'ForeignKey',
      'uMedida'   => 'ForeignKey',
      'tipoComb'  => 'ForeignKey',
      'precio'    => 'Number',
    );
  }
}
